package com.shop.shop.model;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.JSONPObject;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class OrderMysql {
    private String oid;
    private Long uid;
    private String goodList;//json
    private String payWay;
    private BigDecimal sumPrice;
    private String generateDate;

    public OrderMysql() {
    }

    public OrderMysql(String oid, Long uid, String goodList, String payWay, BigDecimal sumPrice, String generateDate) {
        this.oid = oid;
        this.uid = uid;
        this.goodList = goodList;
        this.payWay = payWay;
        this.sumPrice = sumPrice;
        this.generateDate = generateDate;
    }

    public OrderMysql(Order order){
        this.oid=order.getOid();
        this.uid=order.getUid();
        this.goodList= JSONObject.toJSONString(order.getGoodList());
        this.payWay=order.getPayWay();
        this.sumPrice=order.getSumPrice();
    }
}
